<%--
    发布公告腹界面
    Author: scm
    Date: 2023-12-12
    Version: 1.0
--%>
<%--
    返回的数据：新公告的content
    根据返回的数据创建announcement，注意前端不会返回Announcement所有的属性
--%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page session="true" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/bootstrap.css">
  <link rel="stylesheet" href="<c:url value="/resources/css/systemStyle.css"/>">
  <title>校园社团管理系统</title>
</head>
<body>
<!-- 顶部导航栏 -->
<jsp:include page="./header.jsp" />
<div class="content container">
  <div class="fs-4 fw-bolder md-3">发布公告</div>
  <div class="text-center">
    <c:if test="${!empty sessionScope.deleted}">
      <c:choose>
        <c:when test="${sessionScope.deleted}">
          <span class="text-success">发布成功!</span>
          <c:remove var="deleted" scope="session"/>
        </c:when>
        <c:otherwise>
          <span class="text-danger">发布失败</span>
          <c:remove var="deleted" scope="session"/>
        </c:otherwise>
      </c:choose>
    </c:if>
  </div>
  <form action="<c:url value='../clubAdministrator/publishAnnouncement' />" method="post">
    <div class="input-group row mb-3">
      <label for="content" class="form-label">公告内容：</label>
      <textarea class="form-control" name="content" aria-label="content" id="content"></textarea>
    </div>
    <button type="submit" class="btn btn-outline-success mx-2">发布</button>
    <button type="reset" class="btn btn-outline-secondary">清空</button>
  </form>
</div>
<div style="height: 20rem"></div>
<!-- footer -->
<jsp:include page="./footer.jsp" />
<script src="<c:url value="/resources/js/bootstrap.bundle.js" />"></script>
</body>
</html>